package com.javaee.wordtree.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

/**
 * RAG回复结果包装类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RagReplyResult {

    /**
     * 生成的回复文本
     */
    private String replyText;

    /**
     * RAG增强信息
     */
    private MessageWithRagInfo.RagEnhancementInfo ragInfo;

    /**
     * 构造方法
     * 
     * @param replyText 回复文本
     * @param ragInfo   RAG信息
     */
    public static RagReplyResult of(String replyText, MessageWithRagInfo.RagEnhancementInfo ragInfo) {
        return new RagReplyResult(replyText, ragInfo);
    }

    /**
     * 创建无RAG信息的结果
     * 
     * @param replyText 回复文本
     */
    public static RagReplyResult withoutRag(String replyText) {
        MessageWithRagInfo.RagEnhancementInfo ragInfo = new MessageWithRagInfo.RagEnhancementInfo();
        ragInfo.setBasedOnRag(false);
        ragInfo.setRagCount(0);
        ragInfo.setValidRagCount(0);
        return new RagReplyResult(replyText, ragInfo);
    }
}
